package com.hzvdvmc.autosale.setting.ui;

import android.app.Activity;
import android.os.Bundle;
import android.widget.CheckBox;
import android.widget.CompoundButton;

import com.hzvdvmc.autosale.R;
import com.hzvdvmc.autosale.base.ActionbarActivity;
import com.hzvdvmc.autosale.base.BaseActivity;
import com.hzvdvmc.autosale.constant.SpKey;
import com.hzvdvmc.autosale.util.SPUtils;

public class InfraredRayActivity extends ActionbarActivity {

    private CheckBox checkBox;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_infrared_ray);
        setCustomeActiorBar("红外扫描设置");
        checkBox = (CheckBox) findViewById(R.id.checkbox);
        checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                SPUtils.getInstance().put(SpKey.INFRARED_RAY, isChecked);
            }
        });
        boolean isRay = SPUtils.getInstance().getBoolean(SpKey.INFRARED_RAY);
        checkBox.setChecked(isRay);
    }
}
